/* demo stylesheet */

body {
  background-color: #fff;
  font-size: 18px;
}

* {
  user-select: none;
}

p {
  padding: 6px;
  position: relative;
  background-color: #eee;
  border-bottom: solid 1px #eee;
}

p+p {
  margin-left: 24px;
  padding-left: 10px;
}

p::after {
  content: '';
  width: 4px;
  height: 100%;
  background-color: aqua;
  position: absolute;
  left: 0;
  bottom: 0;
}

p+p::after {
  content: '';
  background-color: #fff;
}


.grid-warp {
  border: solid 1px #ccc;
  margin: 0 auto;
}

.grid-1 {
  width: 100px;
  height: 100px;
  background-color: aquamarine;
  /* display: grid; */
  display: inline-grid;
}


.grid-box {
  border: sandybrown solid 1px;
  display: grid;
  padding: 10px;
  margin: 10px auto;
  width: 500px;
}

.grid-box>div {}

.grid-box>div:nth-child(1) {
  background-color: #55efc4;
}

.grid-box>div:nth-child(2) {
  background-color: #81ecec;
}

.grid-box>div:nth-child(3) {
  background-color: #74b9ff;
}

.grid-box>div:nth-child(4) {
  background-color: #a29bfe;
}

.grid-box>div:nth-child(5) {
  background-color: #b2bec3;
}

.grid-box>div:nth-child(6) {
  background-color: #ffeaa7;
}

.grid-box>div:nth-child(7) {
  background-color: #fab1a0;
}

.grid-box>div:nth-child(8) {
  background-color: #ff7675;
}

.grid-box>div:nth-child(9) {
  background-color: #fd79a8;
}



.grid-2-1 {
  grid-template-columns: 40px 50px 60px;
  grid-template-rows: 60px 60px 60px;
}


.grid-2-2 {
  grid-template-columns: 50px 20% 60px;
  grid-template-rows: 100px 50px 30px;
}

.grid-2-3 {
  grid-template-columns: repeat(2, 50px 30px);
  grid-template-rows: repeat(2, 50px 20px);
}

.grid-2-4 {
  grid-template-columns: repeat(auto-fill, 100px);
  grid-template-rows: 120px 120px;
}

.grid-2-5 {
  grid-template-columns: 200px 1fr 1fr 1fr 1fr 1fr;
  grid-template-rows: 120px 120px;
}

.grid-2-6 {
  grid-template-columns: 30px 20fr minmax(100px, 1fr);
  grid-template-rows: repeat(3, minmax(20px, 1fr));
}

.grid-2-7 {
  grid-template-columns: 30px auto minmax(100px, 1fr);
  grid-template-rows: repeat(3, minmax(20px, 1fr));
}

.grid-2-8 {
  grid-template-columns: [c1] 100px [c2] 100px [c3] auto [c4];
  grid-template-rows: [r1] 100px [r2] 100px [r3] auto [r4];
}




.grid-3 {
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);

  grid-row-gap: 10px;
  grid-column-gap: 10px;
  /* grid-gap: 20px; */
  /* gap: 30px; */
}

.grid-4 {
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);

  grid-template-areas: 
    "header header header"
    "main main sidebar"
    "footer footer footer";
}

.grid-4>div:nth-child(1) {
  grid-area: main;
}



.grid-5-1 {
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);

  grid-auto-flow: column;
  /* grid-auto-flow: row; */

}

.grid-5-2 {

  grid-template-columns: 200px repeat(2, 100px);
  grid-template-rows: repeat(3, 100px);
  grid-auto-flow: row dense;
}

/* .grid-5-2>div:nth-child(2) {
  grid-column-start: 1;
  grid-column-end: 2;  
} */



.grid-6 {

  grid-template-columns: 200px repeat(2, 100px);
  grid-template-rows: repeat(3, 100px);


  /* 
    start：对齐单元格的起始边缘。
    end：对齐单元格的结束边缘。
    center：单元格内部居中。
    stretch：拉伸，占满单元格的整个宽度（默认值）。 
  */
  /* justify-items: center;
  align-items: center; */
  place-items: center start;
}


.grid-7 {
  grid-template-columns: 200px repeat(2, 100px);
  grid-template-rows: repeat(3, 100px);
  /* tart | end | center | stretch | space-around | space-between | space-evenly; */
  place-content: space-evenly;
}


.grid-8 {

  grid-template-columns: 100px 100px 100px;
  grid-template-rows: 100px 100px;
  grid-auto-rows: 50px;
}

/** grid-template 属性，grid 属性
grid-template属性是
grid-template-columns、
grid-template-rows、
grid-template-areas
这三个属性的合并简写形式。

grid属性是
grid-template-rows、
grid-template-columns、
grid-template-areas、 
grid-auto-rows、
grid-auto-columns、
grid-auto-flow这六个属性的合并简写形式。 **/

/* 
  grid-column-start属性：左边框所在的垂直网格线
  grid-column-end属性：右边框所在的垂直网格线
  grid-row-start属性：上边框所在的水平网格线
  grid-row-end属性：下边框所在的水平网格线
 */

.grid-9 {
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: 100px 100px 1fr;

}

.grid-9>div:nth-child(1) {
  grid-column-start: 1;
  grid-column-end: 3;
}

.grid-9>div:nth-child(3) {
  grid-column-start: span 2;
}

.grid-10 {

  grid-template-columns: repeat(3, 100px);
  grid-template-rows: 100px 100px 1fr;
  grid-auto-rows: 100px;
}

.grid-10>div:nth-child(1) {
  grid-column: 1/3;
  grid-row: 1/3;
}

/* 顺序 grid-row-start、grid-column-start、grid-row-end、grid-column-end */
.grid-10>div:nth-child(3) {
  grid-area: 1/3/3/5;
}


.grid-11 {

  grid-template-columns: repeat(3, 100px);
  grid-template-rows: 100px 100px 1fr;
  grid-auto-rows: 100px;
}

.grid-11>div:nth-child(1) {

  place-self: center center;
}